

import Fetch  from "../utils/fetch"
import Request  from "../utils/request"


// 统一接口文件配置

// 首页轮播图接口    axios实现

// export  const   banner =  () => Fetch.get("/banner")
export  const   banner =  () => Request({
    url:"/api/banner",
    headers:{
        DeviceType: "H5"
    }
})

// 首页接口
// export  const   cartList =  () => Fetch.get("/recommend/appIndex")
export  const   cartList =  () => Request({
   url: "/api/recommend/appIndex",

})


// 特色课筛选规则
export  const   dropdownList =  () => Request({
    url: "/api/courseBasis",
 
 })

 
// 课程详情
export const course_detail = (data) => Request({
	url: `/api/courseInfo/basis_id=${data.basis_id}?`,
	method: 'get',

});

// 报名/立即学习
export const apply_study = (data) => Request({
	url: `/api/order/downOrder`,
	method: 'post',
	data: data
});
//登录
export const login = (data) => Request({
	url: `/api/login`,
	method: 'post',
	params: data
});
//验证码
export const reset = (data) => Request({
	url: `/api/smsCode`,
	method: 'post',
	params: data
});


//密码

export const setPassword = (data) => Request({
	url: `/api/password`,
	method: 'post',
	params: data
});

export const getUserInfo = () => Request({
	url: `/api/userInfo?`,
	method: 'get',
	headers:{
		Authorization:'Bearer ' + localStorage.getItem('token')
	}
});

export const updataInfo = (data) => Request({
	url: `/api/user`,
	method: 'put',
	data: data,
	headers:{
		Authorization:'Bearer ' + localStorage.getItem('token')
	}
});

// 头像

export const updataImg = (data) => Request({
	url: `/api/public/img`,
	method: 'post',
	data: data,
	headers:{
		Authorization:'Bearer ' + localStorage.getItem('token')
	}
});
